import Vue from 'vue'
import App from './App.vue'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import store from './store'; // 引入store
import request from './utils/request'

import animate from 'animate.css'

Vue.config.productionTip = false
Vue.prototype.request=request


Vue.use(ElementUI,{size:'big'});
Vue.use(animate)


const user = localStorage.getItem("user");
const token = localStorage.getItem("token");
localStorage.setItem('activeMenu', "/index")

if (user && token) {
  store.dispatch('loginSuccess', { user: JSON.parse(user), token: token });
}

Vue.use(animate)
Vue.use(ElementUI,{size:'big'});
new Vue({
  store, // 使用store
  router,
  render: h => h(App)
}).$mount('#app')